# -*- coding: utf-8 -*-

import time
import random
from celery import shared_task
from django.core import serializers
from django.db.models import QuerySet

from celery_project.app import celery_app
from django_service.models import TableModel

import logging

logger = logging.getLogger(__name__)


@celery_app.task(name='schedule_task')
def schedule_task():
    time.sleep(60)
    logger.info('task execute')


@celery_app.task(name='menu_task')
def menu_task():
    # queryset: QuerySet = TableModel.objects.all()
    # string: str = serializers.serialize('json', queryset)
    # logger.info(f'TableModel:{string}')

    pass


@shared_task()
def task_async_result(param:str):
    result = param
    return result
